#include "bdsetmodelthread.h"

#include <QDebug>

#include "framewindow.h"

/**
 * @brief 设置北斗工作模式
 * @param frameWindow
 */

BDSetModelThread::BDSetModelThread(FrameWindow *frameWindow)
{
    parent = frameWindow;
}

BDSetModelThread::~BDSetModelThread()
{

}

void BDSetModelThread::run()
{

    emit parent->beidouObject->send_data(command+"\r\n");
    qDebug() << "sending and receiving RUN,thread is:" << QThread::currentThreadId()<< "receiced ";
    parent->beidouObject->mutex.lock();
    if(parent->beidouObject->waitCon.wait(&parent->beidouObject->mutex,3000)){
        qDebug() << "Seting mode and receice SUCCESS!";
    }
    else {
        qDebug() << "Seting mode and receice Timeout! ";
    }
    parent->beidouObject->mutex.unlock();

}
